var i;
Object.defineProperty(exports, "__esModule", {
  value: true
});
var _decorator = cc._decorator;
var _ccclass = _decorator.ccclass;
var _property = _decorator.property;

var _def_UI_Toast = function (e) {
  function _creator() {
    var t = null !== e && e.apply(this, arguments) || this;
    t.txt_toast = null;
    t.anm_toast = null;
    return t;
  }
  __extends(_creator, e);
  _creator.prototype.show = function (e) {
    this.node.active = true;
    this.txt_toast.string = e;
    this.node.width = e.length * this.txt_toast.fontSize + 100;
    this.anm_toast.play();
    this.anm_toast.off(cc.Animation.EventType.FINISHED, this._complete, this);
    this.anm_toast.on(cc.Animation.EventType.FINISHED, this._complete, this);
  };
  _creator.prototype._complete = function () {
    this.node.active = false;
  };
  __decorate([_property(cc.Label)], _creator.prototype, "txt_toast", undefined);
  __decorate([_property(cc.Animation)], _creator.prototype, "anm_toast", undefined);
  return __decorate([_ccclass], _creator);
}(cc.Component);
exports.default = _def_UI_Toast;